This site and its contents are © Rui del-Negro / Azul SPI. You may place links to this page on your site, you may download or print the page for your own personal use and you may put it on-line at any other free public site as long as you do not change it in any way and include a link to dvd-hq.info. Any other use (including, but not restricted to, commercial use) is forbidden without prior written consent by the author.


Bitrate and GOP calculator


The calculator below was originally designed for DVD, but has been updated and can now be used to determine the bitrate values for several different formats. All the calculations are done in your browser, by a script. Therefore you need a browser with JavaScript support, and script execution must be enabled. If you see the message ENABLE SCRIPTS, that means that your browser does not support JavaScript, or that for some reason it is not working correctly. After you enable scripts, you may need to reload the page for it to function properly. This calculator has been tested in Opera, Mozilla and IE.


Instructions


The calculator is divided into two sections. The user settings are displayed on the left and the results are displayed on the right (or below, if your browser window is too narrow to display them side by side). To update the results after editing a value manually, just click on any empty area of the page. Note that for storage calculations (ex., disc size, bitrate), a gigabyte is usually considered to be equivalent to 1000 megabytes, whereas software normally considers that one gigabyte is equivalent to 1024 megabytes (the same is valid for megabytes and kilobytes). Bits are nearly always calculated using a factor of 1000 (not 1024). For this reason, a "4.7 GB" disc actually has only 4.37 "software" gigabytes, but 9.8 Mb (megabits) is equivalent to 9800 kb (kilobits). In this calculator, all values that are displayed in bytes (indicated by an uppercase "B") use a factor of 1024, and all numbers displayed in bits (indicated by a lowercase "b") use a factor of 1000.


Here is a brief description of the different areas:


Source length

Total length of source footage

If your disc will have more than one clip, enter the sum of the lengths of all clips. If you want to encode each clip with different settings, you will have to calculate the bitrate for one at a time, using the Media size or Other assets fields (described below) to decide how much space each clip is allowed to use.


Video format

Determines resolution, frames per second and GOP limit

Select the video standard that your disc will use. Only the GOP limit is shown in the output values, but other details of the video format may be used for internal calculations.


Audio format

Pick a fixed format or specify the bitrate

PCM is the normal format for uncompressed sound. DVD PCM uses 48 KHz, 16 bits and two channels (stereo). VCD MPA uses MPEG-1 audio with a fixed bitrate of 224 kb/s. Most other formats (ex., Dolby Digital, MPEG audio for DVD or SVCD, etc.) can use different levels of compression. If your disc will use one of these, you should enter the bitrate manually (the actual format is not important; just the bitrate). Typical values are between 64 and 512 kb/s (normally between 128 and 384 kb/s, for stereo). Check your format's specifications for the exact values.


Audio streams

Number of independent audio tracks

This refers to the number of audio tracks; not to the number of channels. A 6-channel surround track counts only as one audio stream. Two stereo sound tracks count as two streams. This value is multiplied by the source length and the audio bitrate to determine how much space will be taken up by the audio (this is then subtracted from the available space to determine how much is left for the video).


Rate control

Video bitrate control mode

Normally, the calculator will automatically decide, based on the computed bitrate values, whether you should use CBR or (2-pass) VBR. If for some reason you want to use constant bitrate regardless of the values, select Force CBR, otherwise leave it set to Auto.


Bitrate limit

Select the disc format or enter value manually

This is the bitrate limit allowed by the destination format, including audio, subtitles and other elements. Note that some disc formats may have specific limits for each element (ex., in SVCD discs, the video bitrate must be less than 2520 kb/s, even if you don't use audio)


Media size

Select the disc type or enter value manually

If you are using the whole disc for this movie, simply select the type of disc (if it's listed). If the type of disc you will use is not listed (ex., a 800 MB CD), use the custom field and enter the amount of free space manually. If not all the space on the disc is availabe, you can either enter only the available space in this field, or enter the full size and use the field below (Other assets) to subtract from it.


Other assets

Subtitles, data files, menus, etc.

The value you enter here is subtracted from the Media size to determine the available space. Use this field to take into account other files that will be present in the disc, such as subtitles, menus or data files.



Calculator


Calculator : Settings

Source length:

minutes

Video format:


Audio format:


Custom ( kb/s)

Audio streams:

Rate control:

Bitrate limit:


Custom ( kb/s)

Media size: 


Custom ( MB)

Other assets:

MB

Calculator : Results

Rate control:


Bitrate:

Maximum kb/s
Average kb/s
Minimum kb/s

GOP structure:

I-pictures
P-pictures
B-pictures

GOP limit:

frames

Size (approx.):

Video MB
Audio MB
Other MB
Remaining MB


Results


Some of the calculator's results may not be completely straightforward, so here is a short description of how they are calculated:


Rate control

CBR or 2-pass VBR

Normally, the calculator will suggest 2-pass VBR. It will suggest CBR in two circumstances. First, when you select Force CBR in the first section of the calculator. Second, when there is enough space on the disc to make the average bitrate equal to or greater than the maximum bitrate. In this case, a VBR file would effectively be CBR, therefore it makes no sense to use the VBR mode (which takes longer to encode). If the calculator suggests 2-pass VBR with an average bitrate value that is very close (i.e., within 10%) of the maximum bitrate value, you can greatly reduce the encoding time (with a minimal loss in quality) by selecting CBR mode.


Bitrate

Maximum, average and minimum

The maximum video bitrate is calculated by subtracting the total audio bitrate from the maximum bitrate allowed by the disc format. Using a higher value might make the disc incompatible with many players. Using a lower value should not cause any problems. To make a DVD compatible with as many players as possible, use a value of 8000 kb/s or less (some older DVD players may have problems when the video bitrate goes beyond that value). The average bitrate is calculated by dividing the free disc space (taking the audio into account) by the project length, leaving a small safety margin (typically between 2% and 5%) in case the encoder does not stick to the value, and to allow for normal file overhead. Using a higher value might cause the resulting file to be too big to fit in one disc. Using a lower value should not cause any problems. The minimum bitrate is calculated simply as a percentage of the average bitrate. Using a different value should not cause any problems. Some programs prefer files where the bitrate never drops below a certain value (ex., 2000 kb/s). If this is the case with your authoring program, and the value suggest by the calculator is lower, increase it to that value. Note that (obviously), the minimum bitrate should always be less than the average bitrate, and the average bitrate should always be less than the maximum bitrate.


GOP structure

I-pictures, P-pictures and B-pictures

The calculator suggests a value for the number of pictures of each type (I per GOP, P per I and B per P), followed by a range of other possible values. For example "2 [ 0 - 5 ] " means 2 is the recommended value, but values between 0 and 5 should also produce good results (depending on the combinations with the other picture types). The values suggested by the calculator assume that you want to use consistent GOPs. In other words, the calculator assumes that the GOP structure will be the same throughout the file. Many encoders have an option to automatically detect scene changes, which starts a new GOP when it detects big changes from the previous frame. This usually improves quality but makes some GOPs different from others. Unless you have a very good reason not to (ex., creating multi-angle video streams), you should always enable this option. And, in this situation, you should use long GOPs (a long GOP is one where the total number of frames is close to the GOP limit for that format), since the encoder will automatically break them when necessary. In other words, even though the calculator suggests using 1 I-picture, 4 P-pictures and 0 B-pictures for a PAL movie with a bitrate of 9 Mb/s, if you enable automatic scene detection, then you should use a number closer to 14 P-pictures instead (ex., 12). If all this sounds too complicated, just use the suggested value; it will still result in good quality with automatic scene detection. For a longer description of picture types and GOP structure, see the TMPGEnc compression guide (use the menu on the left).


GOP limit

15 (PAL) or 18 (NTSC)

The maximum number of frames in a GOP (the GOP size limit) is determined by the DVD video format. If you are encoding video for a different format, alter this value to match its limit.


Size

Video, audio, other and remaining

This area of the calculator tells you the approximate size of the files that will be created if you use the suggested settings. Normally the calculator will try to use all the available space, leaving only a small margin for safety and extras (ex., file headers, project data, etc.). The exception to this is when the average bitrate matches the limit for the format (in this situation, since the bitrate cannot be increased, some space will be left unused).



NOTE: As mentioned elsewhere in this site, I have very little experience with VCD and SVCD formats. The values and formulas used for those formats in this calculator are based on specifications obtained from several internet sites and documents. I have not tested them personally. If you notice any errors, or if you have any questions or comments about this calculator, post a message in the forum. If you have found this calculator useful, please make a donation.